package com.xh.audit.vo.webform;

import com.mybatisflex.core.query.QueryWrapper;
import com.xh.audit.entity.auditdocument.AuditDocumentTemplate;
import com.xh.audit.entity.auditdocument.table.AuditDocumentTemplateTableDef;
import lombok.Data;
import lombok.EqualsAndHashCode;


@Data
@EqualsAndHashCode(callSuper = true)
public class AuditDocumentTemplateQuery extends PageParams<AuditDocumentTemplate> {
    private String templateCode;
    private String templateName;
    private Integer templateType;


    public QueryWrapper queryWrapperBuild() {
        QueryWrapper queryWrapper = QueryWrapper.create()
                .and(AuditDocumentTemplateTableDef.AUDIT_DOCUMENT_TEMPLATE.TEMPLATE_CODE.eq(templateCode))
                .and(AuditDocumentTemplateTableDef.AUDIT_DOCUMENT_TEMPLATE.TEMPLATE_TYPE.eq(templateType))
                .and(AuditDocumentTemplateTableDef.AUDIT_DOCUMENT_TEMPLATE.TEMPLATE_NAME.likeLeft(templateName));
        return queryWrapper;
    }
}
